package com.items.controller;


import com.items.websocket.P2pWebsocket;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class WebsocketController {

    @GetMapping("/list")
    public List<String> getSession(){
        return P2pWebsocket.getSessions();
    }

    @GetMapping("/accepter")
    public void accepter(@RequestParam String initiator ,@RequestParam String accepter){
        P2pWebsocket.accepter(initiator,accepter);
    }
}
